<?php
class sfWidgetLogicalPeriod extends sfWidgetForm {

	protected function configure($options = array(), $attributes = array())
	{

	}


	public function render($name, $value = null, $attributes = array(), $errors = array())
	{
		$logical_widget  = new sfWidgetFormChoice( array ( 'choices'=>$this->getChoices()));
		$input_widget  = new sfWidgetFormInput();
		
		$logical_widget_v = !empty($value['logical']) ? $value['logical'] : null;
		$input_widget_v = !empty($value['input']) ? $value['input'] : null;
		
		$html = $logical_widget->render($name.'[logical]',$logical_widget_v);
		$html .= ' ';
		$html .= $input_widget->render($name.'[input]',$input_widget_v);;
		$html .= ' % ';
		
		
		return $html;
	}
	
	protected function getChoices(){
		return array(
		   "" => globals::CHOOSE_EMPTY_VALUE 
		 , Criteria::GREATER_THAN =>Criteria::GREATER_THAN 
		 , Criteria::GREATER_EQUAL =>Criteria::GREATER_EQUAL 
		 , Criteria::LESS_THAN  =>Criteria::LESS_THAN 
		 , Criteria::LESS_EQUAL   =>Criteria::LESS_EQUAL 
		 , Criteria::EQUAL    =>Criteria::EQUAL 
		);
	}
	
}